const mongoose = require('mongoose')
const moment = require('moment')
require('./Article')
require('./AdminUser')
const schema = new mongoose.Schema({
    Aid: {
        type: mongoose.SchemaTypes.ObjectId,
        ref: 'Article'
    },
    Uid: {
        type: mongoose.SchemaTypes.ObjectId,
        ref: 'AdminUser'
    },
    To: {
        type: String,
    },
    parentId: {
        type:String,
        default: '0'
    },
    created_time:{
        type:String,
        default:moment(new Date()).format('YYYY-MM-DD')
    },
    content: {
        type: String
    }
})

module.exports = mongoose.model('Comment',schema)